12. Syncing Models, db.create_all()

db.create_all()

ND004 C01 L03 11.2 SQLAlchemy(App) Db.Model And Db.Create All()

SQLAlchemy(app) db.Model and db.create_all()

Checking that the person model has been created as a table in the database

ND004 C01 L03 11.3 SQLAlchemy(App) Db.Model And Db.Create All()

Auto-incrementing

ND004 C01 L03 11.4 SQLAlchemy(App) Db.Model And Db.Create All()

SQLAlchemy(app) db.Model and db.create_all()

What command do we run to creates tables for SQLAlchemy models?

SOLUTION: db.create_all()

T/F

If the table user already exists in our database, and a class User(db.Model) was defined, and db.create_all() was run, then

SOLUTION: No new tables get created

Let's practice. Complete Exercise 3.

Workspace

This section contains either a workspace (it can be a Jupyter Notebook workspace or an online code editor work space, etc.) and it cannot be automatically downloaded to be generated here. Please access the classroom with your account and manually download the workspace to your local machine. Note that for some courses, Udacity upload the workspace files onto https://github.com/udacity , so you may be able to download them there.

Workspace Information:

  • Default file path:
  • Workspace type: jupyter-lab
  • Opened files (when workspace is loaded): n/a